package ru.sgu.diploma.practic.service.impl;

import ru.sgu.diploma.practic.service.StatesGenerator;

import java.util.Random;

/**
 * User: datmakin
 * Date: 14.03.11
 * Email: atmakin.dv@gmail.com
 */
public class StatesGeneratorImpl implements StatesGenerator {

    private Integer length = 50;

    public String[] generateStateForAlphabet(String[] alphabet) {
        Random random = new Random();
        String[] result = new String[length];
        for(int i = 0; i < length; i++)
            result[i] = alphabet[random.nextInt(alphabet.length)];
        return result;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }
}
